<template>
	<view class="content">
		<!-- <view>这是test组件{{num}}</view>
		<view>这是父组件传递过来的数据{{title}},{{name}}</view>
		<view>
			<button type="primary" @click="sendNum">给父组件传值</button>
		</view> -->
		<view class="title">{{title}}...</view>
		<view class="art-content">
			<rich-text :nodes="strings"></rich-text>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				/* num:3,
				intId:null */
				title:'',
				strings:''
			}/* ; */
		},
		onLoad:function(e) {
					console.log(e.newsid);
					uni.request({
						url:'https://unidemo.dcloud.net.cn/api/news/36kr/'+e.newsid,
						method:'GET',
						data:{},
						success:res=>{
							console.log(res);
							this.title=res.data.title;
							this.strings =res.data.content;
						},
						fail :()=>{},
						complete:()=>{}
					});
				}
		/* props:['title','name'],
		methods:{
			sendNum(){
				console.log('给父亲传值')
				this.$emit('myEven',this.num)
			}
		},
		beforeCreate() {
			console.log('实例已经开始初始化了')
			console.log(this.num)
		} */
	}
</script>

<style>
	.content{
		padding: 10upx 2%;
		width: 96%;
		flex-wrap: wrap;
	}
	.title{
		line-height: 2em;
		font-weight: 700;
		font-size: 38upx;
	}
	.art-content{
		line-height: 2em;
	}
</style>